{% extends 'BudgetBudgetBundle::layout.html.twig' %}

{% block stylesheets %}
    {{ form_stylesheet(form) }}
    {% stylesheets 'bundles/budgetbudget/css/*' filter='cssrewrite' %}
        <link href="{{ asset_url }}" rel="stylesheet">
    {% endstylesheets %}
    
    {% stylesheets 'bundles/budgetbudget/css/jquery-ui.css' filter='cssrewrite' output='bundles/budgetbudget/css/jquery-ui.css'%}
        <link href="{{ asset_url }}" rel="stylesheet">
    {% endstylesheets %}
    
    {% stylesheets 'bundles/budgetbudget/css/style.css' filter='cssrewrite' output='../bundles/budgetbudget/css/style.css'%}
        <link href="{{ asset_url }}" rel="stylesheet">
    {% endstylesheets %}
    
    {% stylesheets '@BudgetBudgetBundle/Resources/public/jqplot/jquery.jqplot.css' filter='cssrewrite' %}
        <link rel="stylesheet" type="text/css" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}    
    
{% block javascripts %}
    {{ form_javascript(form) }}
    <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
   
    {% javascripts '@BudgetBudgetBundle/Resources/public/jqplot/excanvas.js' %}
        <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="{{ asset_url }}"></script><![endif]-->
    {% endjavascripts %}
    
     {% javascripts '@BudgetBudgetBundle/Resources/public/ring.js/underscore.js'
        '@BudgetBudgetBundle/Resources/public/ring.js/ring.js' %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}

    {% javascripts '@BudgetBudgetBundle/Resources/public/jqplot/jquery.jqplot.min.js'
        '@BudgetBudgetBundle/Resources/public/jqplot/plugins/jqplot.dateAxisRenderer.min.js'
        '@BudgetBudgetBundle/Resources/public/jqplot/plugins/jqplot.canvasTextRenderer.min.js'
        '@BudgetBudgetBundle/Resources/public/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js'
        '@BudgetBudgetBundle/Resources/public/jqplot/plugins/jqplot.pointLabels.min.js'
        '@BudgetBudgetBundle/Resources/public/jqplot/plugins/jqplot.categoryAxisRenderer.min.js'
        '@BudgetBudgetBundle/Resources/public/jqplot/plugins/jqplot.barRenderer.min.js' %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}
    
    {% javascripts '@BudgetBudgetBundle/Resources/public/js/income.js'
        '@BudgetBudgetBundle/Resources/public/js/moment.js'
        '@BudgetBudgetBundle/Resources/public/js/incomeGrid.js' 
        '@BudgetBudgetBundle/Resources/public/js/incomeAdd.js' 
        '@BudgetBudgetBundle/Resources/public/js/incomeChart.js' %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
    {% endjavascripts %}
    
    <script type="text/javascript">
      $( document ).ready(function() {
         var options = {
            url: '{{ path("BudgetBudgetBundle_incomes_data_json") }}',
            url_edit: '{{ path("BudgetBudgetBundle_incomes_edit_data_json") }}',
            url_del: '{{ path("BudgetBudgetBundle_incomes_del") }}',
            url_data: '{{ path('BudgetBudgetBundle_incomes_data_chart') }}'
         }
         var chart = new incomeChart();
         incomeGrid.getIncomesToJsonJqGrid(options); 
         incomeAdd.add('{{ path('BudgetBudgetBundle_incomes_data_chart') }}', chart);
         income.selectMonth('{{ path('BudgetBudgetBundle_incomes_data_chart') }}', chart);
         chart.refresh('chart1', '{{ path('BudgetBudgetBundle_incomes_data_chart') }}');
      });
    </script>
{% endblock %}
        
{% block home_content %}
    <div class="container">
       {% include 'BudgetBudgetBundle:Income:new.html.twig' %}  
       
        <div class="row">  
            <div class="col-sm-6" id="income-chart-box">
                {% include 'BudgetBudgetBundle:Income:chart.html.twig' %}  
            </div>
            <div class="col-sm-6" id="income-list-box">
                {% include 'BudgetBudgetBundle:Income:list.html.twig' %}  
            </div>
        </div> 
       
    </div>        
{% endblock %}
